<?php	

define('slides_dir', '/upload/slides/');

// This theme uses post thumbnails
if ( function_exists( 'add_theme_support' ) )
{
	// Added in 2.9
	add_theme_support( 'post-thumbnails' );
	add_image_size( 'slider-post-thumbnail', 1000, 300, true ); // Slider Thumbnail
}

// remove unused dashboard widgets
function remove_dashboard_widgets()
{
	global $wp_meta_boxes;

	unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_quick_press']);		//快速发布
	unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_primary']);			//WordPress China 博客
	unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_secondary']);			//其它WordPress新闻
	//unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_recent_drafts']);	//近期草稿

	unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_incoming_links']);	//链入链接
	//unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_right_now']);		//概况
	unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_plugins']);			//插件
	unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_recent_comments']);	//近期评论

}
add_action('wp_dashboard_setup', 'remove_dashboard_widgets' );

//register post types
/* Slider */
function my_post_type_slider() {
	register_post_type( 'slider',
			array(
					'label' => __('幻灯片'),
					'singular_label' => __('幻灯片', 'devster'),
					'_builtin' => false,
					'exclude_from_search' => true, // Exclude from Search Results
					'capability_type' => 'page',
					'public' => true,
					'show_ui' => true,
					'show_in_nav_menus' => false,
					'rewrite' => array(
							'slug' => 'slide-view',
							'with_front' => FALSE,
					),
					'query_var' => "slide", // This goes to the WP_Query schema
					'menu_icon' => get_bloginfo('stylesheet_directory') . '/images/icon_slides.png',
					'supports' => array(
							'title',
							'custom-fields',
							'editor',
							'thumbnail')
			)
	);
}
add_action('init', 'my_post_type_slider');

?>